package com.kcwx.system.dtomap;

import org.mapstruct.*;
import com.kcwx.common.core.domain.entity.SysUser;
import com.kcwx.shareddomain.system.dto.SysUserEditDto;

/**
 * 用户 mapstruct
 *
 */
@Mapper(componentModel = "spring",unmappedSourcePolicy= ReportingPolicy.IGNORE,nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
public interface SysUserMap {
    /** addDto to Entity*/
    @Mappings({@Mapping(target = "id", ignore = true),@Mapping(source = "roleIds", target = "roleIds"),@Mapping(source = "postIds", target = "postIds")})
    SysUser AddDtoToEntity(SysUserEditDto addDto);
    /** editDto to Entity*/
    @Mappings({@Mapping(target = "password", ignore = true),@Mapping(source = "roleIds", target = "roleIds"),@Mapping(source = "postIds", target = "postIds")})
    SysUser EditDtoToEntity(SysUserEditDto editDto);
}
